QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Getting Image Characteristics

GraphicsImportGetNaturalBounds

Returns the bounding rectangle of an image.

extern pascal ComponentResult GraphicsImportGetNaturalBounds (
                     GraphicsImportComponent ci,
                     Rect *naturalBounds);
ci
Specifies the component instance that identifies your connection to the graphics importer component.
naturalBounds
A pointer to a rectangle structure describing the size of the bounding rectangle for the image.

DISCUSSION

You can use the GraphicsImportGetNaturalBounds function to determine the native size of the image associated with a graphics importer component. The natural bounds are always zero-based. This is a convenience function that simply calls GraphicsImportGetImageDescription and extracts the width and height fields.

RESULT Codes

noErr

0

No error

paramErr

-50

Invalid parameter specified

memFullErr

-108

Not enough memory available

GraphicsImportGetImageDescription

Returns image description information.

extern pascal ComponentResult GraphicsImportGetImageDescription (
                     GraphicsImportComponent ci,
                     ImageDescriptionHandle *desc);
ci
Specifies the component instance that identifies your connection to the graphics importer component.
desc
A handle to an image description structure.

DISCUSSION

The GraphicsImportGetImageDescription function returns an image description structure containing information such as the format of the compressed data, its bit depth, natural bounds, and resolution. The caller is responsible for disposing of the returned image description handle.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

memFullErr

-108

Not enough memory available

GraphicsImportGetDataOffsetAndSize

Returns the offset and size of the compressed image data within a file.

extern pascal ComponentResult GraphicsImportGetDataOffsetAndSize (
                     GraphicsImportComponent ci,
                     unsigned long *offset,
                     unsigned long *size);
ci
Specifies the component instance that identifies your connection to the graphics importer component.
offset
A pointer to a value describing the byte offset of the image data from the beginning of the data source.
size
A pointer to a value describing the size of the image data in bytes.

DISCUSSION

This function returns the offset and size of the actual image data within the data source. By default the offset returned is 0 and the size returned is the size of the file. However, some graphics import components will override this function to skip over unneeded information at the beginning or end of the file.

RESULT CODES

noErr

0

No error

paramErr

-50

Invalid parameter specified

memFullErr

-108

Not enough memory available

 


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next